(()=>{
    var app = new Vue({
        el:'#header',
        data:{
            user:user,
            paymentMoney:paymentMoney
        }
    });

    /*选择支付类型事件*/
    $('.payment_type').find(':radio').click(function () {
        $('.payment_type >li').removeClass('this');
        $(this).parents('li').addClass('this');
    });

    //验证填写
    $('#form').Validform({
        tiptype:4,
        datatype:{
            selectOne:function (g,o,c,r) {
                var count = 1;
                var xuan = o.parents('.payment_type').find(':radio:checked').length;
                return count == xuan?true:false;
            }
        },
        ajaxPost:true,
        beforeSubmit:function (form) {
          layer.load(1);
        },
        callback:function (da) {
            layer.closeAll();
            if(da.statue == 'n'){
                layer.msg(da.info,{icon:2});
            }
            else if(da.statue == 'y'){
                layer.confirm('订单支付成功',{icon:1,btn:['查看详情','返回首页'],end:function () {
                        location.href=DURL+'/index';
                    }},function () {
                    location.href=DORDER+'/ordersce/ordersid/'+da.info;
                });

            }

        }
    });
})();